<template>
  <div style="width: 100%">
    <v-details :inputConfig="inputConfig"
               :detailData='inputData.detailData'
               @pop="setdata"></v-details>

  </div>
</template>

<script>
import baseMixin from "@/mixins/BaseMixin";
import skipMixin from "@/mixins/SkipMixin";
import details from '@/components/commons/Detail'

export default {
  name: "",
  mixins: [baseMixin, skipMixin],
  props: {
    inputData: {
      type: Object
    }
  },
  data () {
    return {
      dialogTableVisible: false,
      rules: {
      },
      choseFormData: {}
    };
  },
  computed: {
    inputConfig () {
      return [
        [
          {
            label: this.$t('outbound.userlinenumber'),
            props: "lineno",
            type: "input",
            disabled: true
          },
          {
            label: this.$t('in.rtxxlms'),
            props: "rtxxlms",
            type: "input",
            disabled: true
          },
          {
            label: this.$t('in.receiptkey2'),
            props: "receiptkey",
            type: "input",
            disabled: true
          },
          {
            label: this.$t('in.stylekey'),
            props: "style",
            type: "input",
            disabled: true
          },
          {
            label: this.$t('bill.customer'),
            props: "rtxcustom",
            type: "input",
            disabled: true
          },
          {
            label: this.$t('in.rtxxlms1'),
            props: "物料名称",
            type: "input",
            disabled: true,
          },
        ],
        [

          {
            label: this.$t('in.stuffName'),
            props: "descr",
            type: "input",
            disabled: true
          },
          {
            label: this.$t('in.stuffCode'),
            props: "sku",
            type: "input",
            disabled: true,
          },
          {
            label: this.$t('in.lottable06'),
            props: "lottable06",
            type: "input",
            disabled: true
          },
          {
            label: this.$t('in.lottable09'),
            props: "lottable08",
            type: "input",
            disabled: true,
          },
          {
            label: this.$t('in.lpn'),
            props: "lpn",
            type: "input",
            disabled: true
          },
          {
            label: this.$t('in.rtxcheckcode'),
            props: "rtxcheckcode",
            type: "table",
            disabled: false,
            tableConfig: [{
              label: this.$t('common.code'),
              prop: "code",
              input: "input",
              disabled: false
            }, {
              label: this.$t('common.desc'),
              prop: "description",
              width: '100px',
              input: "input",
              disabled: false
            },],
            url: `queryFromCodelkup/QUALITYINSPECTION/1`,
          },
        ],
        [
          {
            label: this.$t('in.defectremark'),
            props: "rtxcheckname",
            type: "input",
            disabled: true
          }
          ,
          {
            label: this.$t('in.defectremark',{no:1}),
            props: "defectremark1",
            type: "table",
            disabled: false,
            tableConfig: [{
              label: this.$t('common.code'),
              prop: "code",
              input: "input",
              disabled: false
            }, {
              label: this.$t('common.desc'),
              prop: "description",
              width: '100px',
              input: "input",
              disabled: false
            },],
            url: `queryFromCodelkup/ERRORCODE/1`,
          }
          ,
          {
            label: this.$t('in.defectremark',{no:2}),
            props: "defectremark2",
            type: "table",
            disabled: false,
            tableConfig: [{
              label: this.$t('common.code'),
              prop: "code",
              input: "input",
              disabled: false
            }, {
              label: this.$t('common.desc'),
              prop: "description",
              width: '100px',
              input: "input",
              disabled: false
            },],
            url: `queryFromCodelkup/ERRORCODE/1`,
          }
          ,
          {
            label: this.$t('in.defectremark',{no:3}),
            props: "defectremark3",
            type: "table",
            disabled: false,
            tableConfig: [{
              label: this.$t('common.code'),
              prop: "code",
              input: "input",
              disabled: false
            }, {
              label: this.$t('common.desc'),
              prop: "description",
              width: '100px',
              input: "input",
              disabled: false
            },],
            url: `queryFromCodelkup/ERRORCODE/1`,
          },
          {
            label: this.$t('in.defectremark',{no:4}),
            props: "defectremark4",
            type: "table",
            disabled: false,
            tableConfig: [{
              label: this.$t('common.code'),
              prop: "code",
              input: "input",
              disabled: false
            }, {
              label: this.$t('common.desc'),
              prop: "description",
              width: '100px',
              input: "input",
              disabled: false
            },],
            url: `queryFromCodelkup/ERRORCODE/1`,
          },
          {
            label: this.$t('in.defectremark',{no:5}),
            props: "defectremark5",
            type: "table",
            disabled: false,
            tableConfig: [{
              label: this.$t('common.code'),
              prop: "code",
              input: "input",
              disabled: false
            }, {
              label: this.$t('common.desc'),
              prop: "description",
              width: '100px',
              input: "input",
              disabled: false
            },],
            url: `queryFromCodelkup/ERRORCODE/1`,
          },

        ],
      ]
    },
  },
  created () {
  },
  methods: {
    setdata (data, id, close, listId) {
      this.choseFormData = data;//选中表格的一行,赋值给对象
      if (id == 5 && listId == 1) {
        this.inputData.detailData.rtxcheckcode = data.code
      } else if (id == 1 && listId == 2) {
        this.inputData.detailData.defectremark1 = data.code
      } else if (id == 2 && listId == 2) {
        this.inputData.detailData.defectremark2 = data.code
      } else if (id == 3 && listId == 2) {
        this.inputData.detailData.defectremark3 = data.code
      } else if (id == 4 && listId == 2) {
        this.inputData.detailData.defectremark4 = data.code
      } else if (id == 5 && listId == 2) {
        this.inputData.detailData.defectremark5 = data.code
      }
      close(false);
    },
  },
  mounted () {
  },
  watch: {},
  components: {
    'v-details': details,
  },

}
</script>

<style scoped>
</style>
